//import java.util.ArrayList;
//import java.util.List;
//import java.util.Scanner;
//
//public class Main {
//    public static void main(String[] args) {
//        Scanner scanner = new Scanner(System.in);
//        String s = scanner.next();
//        List ArrayList = new ArrayList<String>();
//        while (scanner.hasNext()) {
//            ArrayList.add(scanner.next());
//        }
//        int[] a = new int[ArrayList.size()];
//        for (int i = 0; i < ArrayList.size(); i++) {
//            String name = (String) ArrayList.get(i);
//            for (int j = 0; j < ArrayList.size(); j++) {
//                if (name.equals(ArrayList.get(j))){
//                    a[i]++;
//                }
//            }
//        }
//        int max = 0;
//        String Person ="";
//        for (int i = 0; i < ArrayList.size(); i++) {
//            if (a[i] > max){
//                max = a[i];
//                Person = (String) ArrayList.get(i);
//            }
//        }
//        System.out.println(Person);
//    }
//}
import java.util.HashMap;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        HashMap<String, Integer> attendanceCount = new HashMap<>();
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入出勤记录（以空格分隔，输入结束按 Enter 键）：");

        // 不断读取输入
        while (scanner.hasNext()) {
            String name = scanner.next();
            if (attendanceCount.containsKey(name)) {
                // 如果名字已在字典中，出勤次数加 1
                attendanceCount.put(name, attendanceCount.get(name) + 1);
            } else {
                // 名字不在字典中，添加并初始化为 1
                attendanceCount.put(name, 1);
            }
        }

        int maxAttendance = 0;
        String mostAttendedPerson = "";

        // 找出出勤次数最多的人
        for (String person : attendanceCount.keySet()) {
            int count = attendanceCount.get(person);
            if (count > maxAttendance) {
                maxAttendance = count;
                mostAttendedPerson = person;
            }
        }

        // 输出出勤最多的人
        System.out.println("出勤最多的人是：" + mostAttendedPerson);
    }
}
